<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面尺寸事件</title>
    <style>
        div{
            height: 400rem;
            border: 1px solid black;
            
        }
    </style>
</head>
<body>
    <div>
        Hello world!
    </div>
    <script>
        window.addEventListener('resize',function(){
            console.log('窗口已变更')
        })
        console.log(window.getComputedStyle(document.documentElement).fontSize)
    </script>
    <style>
        div{
            background-color: aliceblue;
            font-size: 4rem;
        }
    </style>
</body>
</html>